#!/bin/sh
# Simple unrar installer script, by Jamie Wilkinson <jamie@tave.com>


alert --warning 	"Install unrar, edit your expander.rules to have Expander support RAR archives, and register the 'application/x-rar-compressed' MIME type?" \
			"No way." "Sure" || \
			
		(
			cp unrar /boot/home/config/bin/ ;
			mimeset -f /boot/home/config/bin/unrar ;
			cp rar /boot/home/config/bin/ ;
			mimeset -f /boot/home/config/bin/rar ;

			echo  >> /boot/home/config/etc/expander.rules
			echo  >> /boot/home/config/etc/expander.rules
			#echo -e \"application/x-rar\"	.rar	\"unrar l %s\"		\"unrar x -y %s\" >> /boot/home/config/etc/expander.rules ;
			echo -e \"\"						.rar	\"unrar l %s\"		\"unrar x -y %s\" >> /boot/home/config/etc/expander.rules ;
			echo -e \"application/x-rar-compressed\"	.rar	\"unrar l %s\"		\"unrar x -y %s\" >> /boot/home/config/etc/expander.rules ;	
			
			#setmime -set application/x-rar -short "RAR Archive" -long "RAR " -preferredAppSig application/x-vnd.Be-EXPD -extension rar -extension RAR ;
			setmime -set application/x-rar-compressed -short "RAR Compressed File" -long "RAR compressed file" -preferredAppSig application/x-vnd.Be-EXPD ;
		
			alert --info "Have fun." "Sweetness"
		)
